<?php
class Client extends Zend_Db_Table{
	protected $_name='plm_client';

	public function __construct(){
			parent::__construct();			
			$this->db=Zend_Registry::get('dbAdapter');
	}

	function edit($info)
	{
		Zend_Loader::loadClass('Zend_Filter_StripTags');
		$filter = new Zend_Filter_StripTags();
		$client_company = trim($filter->filter($info['client_company']));
		$client_industry = trim($filter->filter($info['client_industry']));
		$client_host  = trim($filter->filter($info['client_host']));		
		if ($client_company && $client_industry) {
			$data = array(
				'client_company'	 => $client_company,
				'client_industry'	 => $client_industry,
				'client_host'	  	 => $client_host
				);
			if (!empty($info['client_id'])) {
				$id = intval($filter->filter($info['client_id']));
				$this->update($data,'client_id='.$id);	
			} else {
				$this->insert($data);
			}
			
			return true;
		}

	}
	
	
	
	function del($ids){		
		if(is_numeric($ids)){
			$this->delete("client_id=".$ids);
			return true;
			}
		else{
			$this->delete("client_id in ($ids)");
			return true;
			}
		}


}
?>